<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <title>51问医生</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    {{--<link rel="shortcut icon" href="/Public/mobile/favicon.ico" type="image/x-icon" />--}}
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="yes"/>
    <script src="{{url('/js/jquery.min.js')}}" type="text/javascript"></script>
    <link rel="stylesheet" href="{{url('new/css/common.css')}}" />

    <!-- Noty 提示框的js集成 -->
    <script src="{{ url('vendor/noty-2.2.9/packaged/jquery.noty.packaged.js') }}"></script>
    <script src="{{ url('vendor/noty-2.2.9/themes/bootstrap.js') }}"></script>
    <script src="{{ url('vendor/noty-2.2.9/options.js') }}"></script>

    <script src="{{url('new/js/doctor_list.js')}}"></script>
    {{--<script src="http://mcdn.anxinyisheng.com/Public/mobile/js/lib_5d2f194.js"></script>--}}
    {{--<script src="http://mcdn.anxinyisheng.com/Public/mobile/js/app_7282afb.js"></script>--}}
    <link rel="stylesheet" href="{{url('new/css/ask.css')}}" />
</head>
<body>
<div class="doctor">
    <div class="docInfo-wrapper ax-boxshadow" >
        <div class="icon-cover">
            <img class='doctor-icon' src="@if($doctor){{route('Api.Image.Show',['id'=>$doctor->doc_img])}}@else{{route('Api.Image.Show',['id'=>0])}}@endif" ></div>
            {{--<img class='doctor-icon' src="http://mcdn.anxinyisheng.com/Public/wxyd/common/img/head_icon_c766c55.png" ></div>--}}
        <div class="doc-info-box">
            <p class="name">@if($doctor){{$doctor->doc_name}}@endif
                <span></span></p>
            <p class="hospital">医院</p>
            <p class="position">@if($doctor){{$doctor->subject}}，{{$doctor->station}}@endif</p></div>
    </div>
    <div class="ask" style="margin-left: 10px;">
        <div class="ask-input">
            <textarea id="question" placeholder="请描述具体的症状和问题，不要透露个人姓名或手机号"></textarea>
        </div>
        {{--<p class="price" ng-if="leftFreeTime">--}}
            {{--<span class="yellow">￥price元</span>--}}
            {{--<span class="line">原价：￥origPrice元</span></p>--}}
        {{--<p class="price" ng-if="!leftFreeTime  && !couponlist.length">--}}
            {{--<span class="yellow">￥price元</span></p>--}}
        {{--<p class="price" ng-if="!leftFreeTime && couponlist.length">--}}
            {{--<span ng-class="{line:curCoupon}">原价：￥origPrice元</span></p>--}}
        <p class="times-tip">
            <span>您可免费提问医生</span></p>
        <coupon></coupon>
        <div class="qa-doctor-autoassign">
            24小时未回复，请选择其他医生进行提问</div>
        <div class="payBtn ax-bareBtn ">
                <div class="btn">
                    <button class="start-chat" id="btn_send">
                        <span></span>
                        <span class="start-chat-text">提问</span>
                    </button>
                </div>
        </div>
        <div class="ax-flexBox  ask-tip">
            <svg>
                <use xlink:href="#exclamation"></use>
            </svg>
            <span>您的问题将被匿名展示，以帮助更多患者</span></div>
    </div>
    {{--<div class="ask-notisOn ax-boxshadowbottom" ng-if="!doc.qa.isOn">--}}
        {{--<p>医生暂时关闭了一答提问，请稍后再来</p>--}}
    {{--</div>--}}
</div>
{{--<div class="ax-bareBtn-qa-back">--}}
    {{--<div>返回</div>--}}
{{--</div>--}}
{{--<div style="display:none">--}}
    {{--<div class="nodata">--}}
        {{--<p>正在加载</p>--}}
    {{--</div>--}}
{{--</div>--}}
<script>
    $(function(){
        $(document).on('click','#btn_send',function(){
            var question = $('#question').val();
            if(question==''){
                noty({type:'error',text:'您还未输入问题哦！',timeout:800});
            }
            $.ajax({
                url:'{{route('Api.User.addQuestion')}}',
                type:'post',
                dataType:'json',
                data:{
                    doc_id:'{{$doctor->user_id}}',
                    question:question
                },
                success:function(obj){
                    if(obj.level=='success'){
                        noty({text:obj.message,type:obj.level,timeout:800,
                            callback:{
                                afterClose:function(){
                                    window.location.href='{{route('M.Home.newDoctorDetail',['id'=>$doctor->id])}}';
                                }
                            }
                        });
                    }
                },
                error:function(obj){
                    var dataJson = obj.responseJSON;
                    noty({type:dataJson.level,text:dataJson.message,timeout:600});
                }
            });
        });
    });
</script>
</body>
</html>